package com.itcam.phaseii.classvariable;

public class ChildGame {
    public static void main(String[] args) {
        int count = 0;

        Child child1 = new Child("白骨精");
        child1.join();
//        count++;
        child1.count++;
        Child child2 = new Child("狐狸精");
        child2.join();
//        count++;
        child2.count++;
        Child child3 = new Child("老鼠精");
        child3.join();
//        count++;

        child3.count++;

        System.out.println(Child.count);
    }

}

class Child {
    private String name;

    public static int count = 0;

    public Child(String name) {
        this.name = name;
    }

    public void join() {
        System.out.println(name + "加入了游戏..");
    }
}
